import React, { Component } from 'react';

import "./main.css";
import Head from './front/header.js';
import Body from './front/body';
import "./App.css";
import base from './base.js';
import PageComponent from './front/pageInfo.js';
import Foot from './front/foot';

const basePath = base().basePath;

class App extends Component {

   constructor(props){
       super(props);
       this.state = {
           url:basePath+'/topic/new',
           pageInfo:{}
       }
   }


  loadUrl(newUrl){
      this.setState(()=>({
          url: newUrl
      }));
  }


  render() {
    return (
        <div>
           <Head fnCallback={this.loadUrl.bind(this)}/>
           <div className="body">
                <div className="content">
                    <div className="col1">
                        <Body url={this.state.url}/>
                    </div>
                </div>
            </div>
            <div className="footer">
               <Foot/>
            </div>
        </div>
    );
  }
}

export default App;
